<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilasu: AES Client APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilasu
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xasu__aes__client__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">AES Client APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga48dae63bdd6476ad22853140b0b23e9a"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xasu__aes__client__apis.html#ga48dae63bdd6476ad22853140b0b23e9a">XAsu_AesOperation</a> (<a class="el" href="struct_x_asu___client_params.html">XAsu_ClientParams</a> *ClientParamPtr, <a class="el" href="struct_asu___aes_params.html">Asu_AesParams</a> *AesClientParamPtr)</td></tr>
<tr class="memdesc:ga48dae63bdd6476ad22853140b0b23e9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends command to ASUFW to perform AES encryption/decryption operation on a given payload data with specified AES mode.  <a href="#ga48dae63bdd6476ad22853140b0b23e9a">More...</a><br/></td></tr>
<tr class="separator:ga48dae63bdd6476ad22853140b0b23e9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaffce56f51b41ed88e0b427545109e858"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xasu__aes__client__apis.html#gaffce56f51b41ed88e0b427545109e858">XAsu_AesKat</a> (<a class="el" href="struct_x_asu___client_params.html">XAsu_ClientParams</a> *ClientParamsPtr)</td></tr>
<tr class="memdesc:gaffce56f51b41ed88e0b427545109e858"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends command to perform AES Known Answer Tests (KAT's).  <a href="#gaffce56f51b41ed88e0b427545109e858">More...</a><br/></td></tr>
<tr class="separator:gaffce56f51b41ed88e0b427545109e858"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaffce56f51b41ed88e0b427545109e858"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 XAsu_AesKat </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_asu___client_params.html">XAsu_ClientParams</a> *&#160;</td>
          <td class="paramname"><em>ClientParamsPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends command to perform AES Known Answer Tests (KAT's). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ClientParamsPtr</td><td>Pointer to the <a class="el" href="struct_x_asu___client_params.html" title="This structure contains client parameters information. ">XAsu_ClientParams</a> structure which holds the client input parameters.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS, if IPI request to ASU is sent successfully.</li>
<li>XASU_INVALID_ARGUMENT, if any argument is invalid.</li>
<li>XASU_QUEUE_FULL, if Queue buffer is full.</li>
<li>XST_FAILURE, if sending IPI request to ASU fails. </li>
</ul>
</dd></dl>
<p>Validate input parameters.</p>
<p>Generate unique ID and register the callback function.</p>
<p>Create command header.</p>
<p>Update request buffer and send an IPI request to ASU. </p>

<p>References <a class="el" href="group__xasu__common__defs.html#ga252acc78bddcaa54067e17202d352548">XASU_AES_KAT_CMD_ID</a>, <a class="el" href="group__xasu__client__info.html#gad0de9c14ad7810516d9f71d5b18c44c1">XAsu_CreateHeader()</a>, <a class="el" href="group__xasu__client__info.html#gga06fc87d81c62e9abb8790b6e5713c55bacf18aeeb8b7146572b4eadc9780ad4cb">XASU_INVALID_UNIQUE_ID</a>, <a class="el" href="group__xasu__common__defs.html#ga45324f6b784470f3d788f90d3a5a9930">XASU_MODULE_AES_ID</a>, <a class="el" href="group__xasu__client__info.html#ga6653ca717c2d2ed8399945c294af2f9f">XAsu_RegCallBackNGetUniqueId()</a>, <a class="el" href="group__xasu__common__defs.html#ga0e29ca164aa8fa3ac30a7b9102b615d9">XASU_UNIQUE_ID_MAX</a>, <a class="el" href="group__xasu__client__info.html#ga202195f871d91b50787438e2782be07f">XAsu_UpdateQueueBufferNSendIpi()</a>, and <a class="el" href="group__xasu__client__info.html#gae0f7072bf1eddf7ee11f1e5852570682">XAsu_ValidateClientParameters()</a>.</p>

</div>
</div>
<a class="anchor" id="ga48dae63bdd6476ad22853140b0b23e9a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 XAsu_AesOperation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_asu___client_params.html">XAsu_ClientParams</a> *&#160;</td>
          <td class="paramname"><em>ClientParamPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_asu___aes_params.html">Asu_AesParams</a> *&#160;</td>
          <td class="paramname"><em>AesClientParamPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends command to ASUFW to perform AES encryption/decryption operation on a given payload data with specified AES mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ClientParamsPtr</td><td>Pointer to the <a class="el" href="struct_x_asu___client_params.html" title="This structure contains client parameters information. ">XAsu_ClientParams</a> structure which holds the client input parameters. </td></tr>
    <tr><td class="paramname">AesParamsPtr</td><td>Pointer to <a class="el" href="struct_asu___aes_params.html" title="This structure is common for both client and handler, which contains AES input and output parameters ...">Asu_AesParams</a> structure which holds the parameters of AES input arguments.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS, if IPI request to ASU is sent successfully.</li>
<li>XASU_INVALID_ARGUMENT, if any argument is invalid.</li>
<li>XASU_QUEUE_FULL, if Queue buffer is full.</li>
<li>XST_FAILURE, if sending IPI request to ASU fails.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Verify the additional status if operation flag is set to XASU_AES_FINAL.<ul>
<li>XASU_AES_TAG_READ, if encryption operation successfully done.</li>
<li>XASU_AES_TAG_MATCHED, if decryption operation successfully done.</li>
<li>Any other value shall be treated as failure. </li>
</ul>
</dd></dl>
<p>Validate the input parameters.</p>
<p>Validate client additional status pointer for critical security calls.</p>
<p>Validate the operation flags for AES CCM mode to ensure all the flags are set.</p>
<p>Validate required parameters for AES initialization operation.</p>
<p>Validate AES operation type.</p>
<p>Validate AES engine mode.</p>
<p>Validate AES key object structure parameters.</p>
<p>Validate IV.</p>
<p>Validate required parameters for AES update operation.</p>
<p>Both AAD and InputData/OutputData address and lengths cannot be zero at once. The minimum length of plaintext/AAD length must be at least 1 byte, while the maximum length can be 0x1FFFFFFC bytes, which is the ASU DMA's maximum supported data transfer length.</p>
<p>If AAD length is non-zero, AAD address must be valid and AAD length within limit.</p>
<p>If AAD Length is zero, AAD address must also be zero.</p>
<p>If Data length is non-zero, both input and output addresses must be valid and data length within limit. AES-CMAC engine mode must not allow data updates.</p>
<p>If Data Length is zero, addresses must also be zero.</p>
<p>For the ECB, CBC, and CFB modes, the plaintext must be a sequence of one or more complete data blocks.</p>
<p>Validate IsLast flag.</p>
<p>Validate tag for AES final operation.</p>
<p>If operation flag is set to INIT,</p>
<ul>
<li>Generate Unique ID.</li>
<li>Save the context.</li>
</ul>
<p>If operation flag is either UPDATE or FINAL,</p>
<ul>
<li>Verify the context.</li>
</ul>
<p>If FINISH operation flag is set, update response buffer details.</p>
<p>Create command header.</p>
<p>Update request buffer and send an IPI request to ASU. </p>

<p>References <a class="el" href="struct_asu___aes_params.html#acbaca353de8471a725a71e5f5446f9fa">Asu_AesParams::AadAddr</a>, <a class="el" href="struct_asu___aes_params.html#adfad68e1cc9e3ae1c77eccf90c691be9">Asu_AesParams::AadLen</a>, <a class="el" href="struct_x_asu___client_params.html#a8952a4f5a171faf07a7a1b4ff24b3ecb">XAsu_ClientParams::AdditionalStatusPtr</a>, <a class="el" href="struct_x_asu___client_params.html#a4807bde0253b2c3f56ddaafad586fafb">XAsu_ClientParams::ClientCtx</a>, <a class="el" href="struct_asu___aes_params.html#a68a64ca073a5d555e50cc5c35eb8591f">Asu_AesParams::DataLen</a>, <a class="el" href="struct_asu___aes_params.html#a31519d08c6b24f9f8350816eeea53a9a">Asu_AesParams::EngineMode</a>, <a class="el" href="struct_asu___aes_params.html#afe686e467cd1092efb9799b6fffe0c4b">Asu_AesParams::InputDataAddr</a>, <a class="el" href="struct_asu___aes_params.html#ad905ff656d5ef82a941d8d04672e226a">Asu_AesParams::IsLast</a>, <a class="el" href="struct_asu___aes_params.html#aa4fafb7b134f05d086bee637e197bc33">Asu_AesParams::IvAddr</a>, <a class="el" href="struct_asu___aes_params.html#a8a76e82972fd8bd873de5d18951e4e1a">Asu_AesParams::IvLen</a>, <a class="el" href="struct_asu___aes_params.html#ac113a4987bddc51d09e267f15bf37c05">Asu_AesParams::KeyObjectAddr</a>, <a class="el" href="struct_asu___aes_params.html#a09ee3096afb8ddb497445225e0996fcf">Asu_AesParams::OperationFlags</a>, <a class="el" href="struct_asu___aes_params.html#acffe7f59e15c53810de5def0b709d923">Asu_AesParams::OperationType</a>, <a class="el" href="struct_asu___aes_params.html#a550a78b5e5b6393c02aec24892c70ec7">Asu_AesParams::OutputDataAddr</a>, <a class="el" href="struct_asu___aes_params.html#a04fcb5707e0af7dbab32dfb6ac7341c3">Asu_AesParams::TagAddr</a>, <a class="el" href="struct_asu___aes_params.html#a8c1d145a818f310ec3f26ee80b923509">Asu_AesParams::TagLen</a>, <a class="el" href="group__xasu__common__defs.html#gaf38a4fd296e3327b4e62b4d8244e1027">XASU_AES_BLOCK_SIZE_IN_BYTES</a>, <a class="el" href="group__xasu__common__defs.html#ga7071dad46885918f563b8586e03d0a53">XASU_AES_CBC_MODE</a>, <a class="el" href="group__xasu__common__defs.html#ga30d8f9306c9e8a365a92247259db30db">XASU_AES_CCM_MODE</a>, <a class="el" href="group__xasu__common__defs.html#ga7627df9f2610f9793e186d2a63de5566">XASU_AES_CFB_MODE</a>, <a class="el" href="group__xasu__common__defs.html#gacc3bdb18dc3dd63126c7088ba676ada1">XASU_AES_CMAC_MODE</a>, <a class="el" href="group__xasu__common__defs.html#gae84fd94e7e06bd553f3b81f97970c1e0">XASU_AES_DECRYPT_OPERATION</a>, <a class="el" href="group__xasu__common__defs.html#gaa368e66adb87155ac40aaae3ea1a3747">XASU_AES_ECB_MODE</a>, <a class="el" href="group__xasu__common__defs.html#gae1f327bfa7f97cff2f8fe44a2ce40b2c">XASU_AES_ENCRYPT_OPERATION</a>, <a class="el" href="group__xasu__common__defs.html#ga2367f379db85cef503b1f5ea5649c7b8">XASU_AES_FINAL</a>, <a class="el" href="group__xasu__common__defs.html#ga266c9d8c0ac689bdb49cbb5cd0d293f9">XASU_AES_GCM_MODE</a>, <a class="el" href="group__xasu__common__defs.html#ga1a7fc5175f05d6d35b470764ec226857">XASU_AES_GHASH_MODE</a>, <a class="el" href="group__xasu__common__defs.html#ga0881d4fe97548eb6d865d5636f4c9125">XASU_AES_INIT</a>, <a class="el" href="group__xasu__aes__common__apis.html#ga9caf443e3e977676111d41dbe2fe35db">XASU_AES_IS_AAD_SUPPORTED_MODE</a>, <a class="el" href="group__xasu__common__defs.html#ga5fbd4af6821ee65fb51764ba461b503e">XASU_AES_OPERATION_CMD_ID</a>, <a class="el" href="group__xasu__common__defs.html#gad65c4224fefdc9297cd8c32b6e148bc9">XASU_AES_UPDATE</a>, <a class="el" href="group__xasu__aes__common__apis.html#gaf650e5321d4f5e9d5e3af59d9690cd15">XAsu_AesValidateIvParams()</a>, <a class="el" href="group__xasu__aes__common__apis.html#ga46d86db456797e1245906452022c98eb">XAsu_AesValidateTagParams()</a>, <a class="el" href="group__xasu__client__info.html#gad0de9c14ad7810516d9f71d5b18c44c1">XAsu_CreateHeader()</a>, <a class="el" href="group__xasu__client__info.html#gga06fc87d81c62e9abb8790b6e5713c55baba48c86a73142cb74e29cb65cbde6a30">XASU_FAIL_SAVE_CTX</a>, <a class="el" href="group__xasu__client__info.html#ga97e484d9d293c91c125205c768cdc7d5">XAsu_FreeCtx()</a>, <a class="el" href="group__xasu__client__info.html#gga06fc87d81c62e9abb8790b6e5713c55ba21f6a079219ddf14b57959e9a40be8b9">XASU_INVALID_ARGUMENT</a>, <a class="el" href="group__xasu__client__info.html#gga06fc87d81c62e9abb8790b6e5713c55bacf18aeeb8b7146572b4eadc9780ad4cb">XASU_INVALID_UNIQUE_ID</a>, <a class="el" href="group__xasu__common__defs.html#ga45324f6b784470f3d788f90d3a5a9930">XASU_MODULE_AES_ID</a>, <a class="el" href="group__xasu__client__info.html#ga6653ca717c2d2ed8399945c294af2f9f">XAsu_RegCallBackNGetUniqueId()</a>, <a class="el" href="group__xasu__common__defs.html#ga0e29ca164aa8fa3ac30a7b9102b615d9">XASU_UNIQUE_ID_MAX</a>, <a class="el" href="group__xasu__client__info.html#ga936fc8dfbd6e1c63ea38d52c0a89f55b">XAsu_UpdateCallBackDetails()</a>, <a class="el" href="group__xasu__client__info.html#gab89446614128abd944047e7c55b1cda2">XAsu_UpdateNGetCtx()</a>, <a class="el" href="group__xasu__client__info.html#ga202195f871d91b50787438e2782be07f">XAsu_UpdateQueueBufferNSendIpi()</a>, <a class="el" href="group__xasu__client__info.html#gae0f7072bf1eddf7ee11f1e5852570682">XAsu_ValidateClientParameters()</a>, and <a class="el" href="group__xasu__client__info.html#ga61795a5278b8baf8896d7a81e03c9f6a">XAsu_VerifyNGetUniqueIdCtx()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
